package com.example.mapper.dm;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.common.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 达梦数据库用户Mapper接口
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 获取所有用户并按照年龄降序排序
     * 达梦数据库特有的查询语法
     */
    @Select("SELECT * FROM t_user ORDER BY age DESC")
    List<User> selectAllOrderByAgeDesc();
} 